package com.zhiliao.visitor.demo1;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * 作者： zhi-liao
 * 类的作用:
 * 类的创建时间： 2021/5/23 16:11
 */
public class ObjectStruture {
    public static List<CustomElement> getList() {
        List<CustomElement> list = new ArrayList<>();
        Random random = new Random();
        for (int i = 0; i < 10; i++) {
            int a = random.nextInt(100);
            if (a > 50) {
                list.add(new ConcreteElement1());
            } else {
                list.add(new ConcreteElement2());
            }
        }
        return list;
    }
}
